<template>
  <div class="dashboard-editor-container">
    <el-card class="overview-card">
      <template #header>
        <div class="card-header">
          <i class="el-icon-view header-icon" />
          <h2>概览</h2>
        </div>
      </template>
      <panel-group />
    </el-card>

    <div class="cards-container">
      <el-card class="split-card">
        <template #header>
          <div class="card-header">
            <i class="el-icon-document header-icon" />
            <h2>站点公告</h2>
          </div>
        </template>
        <site-info />
      </el-card>

      <el-card class="split-card">
        <template #header>
          <div class="card-header">
            <i class="el-icon-document header-icon" />
            <h2>使用帮助</h2>
          </div>
        </template>

        <router-link class="pan-btn green-btn" to="/developer-help/index">
          点击查看密钥使用帮助文档
        </router-link>

        <div>
          <a class="pan-btn tiffany-btn" href="https://gitee.com/crossf1re/license-system-vue" target="_blank"
            rel="noopener noreferrer">
            跳转到前端Gitee界面
          </a>
        </div>
        <div>
          <a class="pan-btn tiffany-btn" href="https://gitee.com/crossf1re/license-system" target="_blank"
            rel="noopener noreferrer">
            跳转到后端Gitee界面
          </a>
        </div>
        <div>
          <a class="pan-btn tiffany-btn" href="https://gitee.com/crossf1re/license-system-sdkcpp" target="_blank"
            rel="noopener noreferrer">
            跳转到C++ SDK Gitee界面
          </a>
        </div>


      </el-card>
    </div>
  </div>
</template>

<script>
import PanelGroup from './components/PanelGroup'
import SiteInfo from './components/SiteInfo.vue';

export default {
  name: 'Homepage',
  components: {
    PanelGroup,
    SiteInfo
  }
}
</script>

<style lang="scss" scoped>
.pan-btn {
  display: block;
  /* Makes them take the full width */
  width: 50%;
  /* Ensures uniform width */
  text-align: center;
  /* Centers the text */
  padding: 10px;
  margin: 10px;
  /* Adjust padding for better spacing */
  box-sizing: border-box;
  /* Ensures padding doesn't affect width */
}

.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;
}

.overview-card {
  background: #fff;
  padding: 0px 20px;
  margin-bottom: 32px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.card-header {
  display: flex;
  align-items: center;
  padding: 8px 0;
}

.card-header h2 {
  margin: 0;
  padding: 0;
  font-weight: bold;
  line-height: 1.2;
  margin-left: 8px;
}

.header-icon {
  font-size: 20px;
  color: #8F87F1;
}

.overview-card ::v-deep(.el-card__header) {
  padding: 10px 20px;
}

/* New cards under the overview-card */
.cards-container {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  /* Space between the cards */
}

.split-card {
  flex: 1;
  background: #fff;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}
</style>
